Image processing apparatus, image processing method, non-transitory computer-readable storage medium, and image pickup apparatus for processing a picked-up image

ABSTRACT

An image processing apparatus for processing a picked-up image which is output from an image pickup element in which a microlens array for obtaining the picked-up image including ray directional information of an object image formed by a photographing optical system has been arranged has: a refocus processing unit for executing a refocus processing of the obtained picked-up image on the basis of the ray directional information and generating a reconstruction image; and a defect pixel detection unit for detecting a defect pixel from the obtained picked-up image. When the picked-up image is obtained, the detection of the defect pixel of the obtained picked-up image is performed. When a refocus processing is instructed, the refocus processing is executed to the picked-up image in which the detection of the defect pixel is performed.

BACKGROUND OF THE INVENTION

Field of the Invention

The present invention relates to an image processing apparatus and, moreparticularly, to an image processing apparatus for processing apicked-up image obtained by an image pickup element having a microlensarray at a front side thereof.

Description of the Related Art

In the related art, there exist many image pickup apparatuses such as anelectronic camera and the like for recording and reproducing a stillimage or a moving image picked up by an image pickup element such asCCD, CMOS, or the like to/from a recording medium serving as a memorycard having a memory element.

An example of techniques regarding those image pickup apparatuses hasbeen proposed in Japanese Patent Application Laid-Open No. S61-261974.Such an image pickup apparatus is constructed in such a manner that amicrolens array (hereinbelow, abbreviated to an MLA) in whichmicrolenses are arranged at a rate of one to a predetermined number ofplurality of pixels is arranged at a front side of an image pickupelement, thereby enabling incident direction information of a ray oflight (ray directional information) which enters the image pickupelement to be also obtained.

Although such an image pickup apparatus is called a Hand-held PlenopticCamera in Ren. Ng. and 7 others, “Light Field Photography with aHand-held Plenoptic Camera”, Stanford Tech Report CTSR 2005-02, it isgenerally also called a “Light Field Camera”.

As an application of such an image pickup apparatus, a normalphotographed image is generated on the basis of an output signal fromeach pixel. As another application, a predetermined image processingbased on the ray directional information is executed to a photographedimage, thereby reconstructing an image focused to an arbitrary focallength (such a processing is called a refocus processing), or the like.

On the other hand, among recent electronic cameras, there exist manycameras each of which is equipped with an image pickup element havingmillions to tens of millions pixels. However, it is practically verydifficult to manufacture an image pickup element in which all pixelsproperly perform a conversion into an electric signal corresponding toan incident light amount. Thus, several “defect pixels” which do notnormally operate exist mixedly in the “pixels” of the image pickupelement.

In the image pickup apparatus in the related art, an interpolationprocessing or the like using an image signal of a peripheral pixel ofthe defect pixel is executed, thereby correcting an image which isfinally generated.

There are several methods of detecting the defect pixel which is acorrection subject. For example, in a manufacturing step of the imagepickup apparatus or image pickup element, methods which record and storean address of the defect pixel in a memory of the image pickup apparatuson the basis of the photographed image have been proposed in JapanesePatent Application Laid-Open No. S61-261974, and Japanese PatentApplication Laid-Open No. 2005-026794, and the like.

As another detecting method, there is a real-time defect pixel detectingmethod of discriminating the defect pixel based on a level difference orthe like from the image signal of the peripheral pixel of the picked-upimage every photographing by the image pickup apparatus. Such a methodhas been proposed in Japanese Patent Application Laid-Open No.2005-286825, or the like.

However, in the photographing by the image pickup apparatus having theMLA as mentioned above, in order to realize the real-time detection ofthe defect pixel, there is the following problem.

That is, in the real-time detecting method of the defect pixel, on thebasis of the level difference between the detection subject pixel andits peripheral pixel, whether or not that detection subject pixel is adefect pixel is discriminated. However, among the image pickupapparatuses having the MLA mentioned above, the image pickup apparatusbased on a prerequisite that the reconstruction for executing thepredetermined image processing such as a refocus processing or the likeis performed has the following problem. That is, an arrangement of thepixel signals at the time of reading out from the image pickup elementor at the time of storing the image data is not always an arrangementcorresponding to a positional relationship of the object images, andthus the image data is of data which may not be suitable for directdisplay to observe. Therefore, if such an arrangement is used as it is,it is difficult to discriminate whether or not the detection subjectpixel is a defect, based on the peripheral pixel signal of the defectpixel as shown in Japanese Patent Application Laid-Open No. 2005-286825.

But, in order to detect the defect pixel, if some reconstructionprocessing is executed in order to obtain the image data which issuitable for direct display to observe the image which is used fordetection, one pixel signal of the image obtained after thereconstruction becomes a signal generated by adding pixel signals of theplurality of image pickup element. Consequently, it is further difficultto detect which pixel of the image pickup element is a defect pixel,based on the pixel signal of the reconstruction image.

SUMMARY OF THE INVENTION

Therefore, an aspect of the invention is to provide an image processingapparatus, image processing method, and program for enabling a properdefect pixel detection to be performed to a picked-up image obtained byan image pickup element having an MLA.

To solve the above problems, according to the invention, an imageprocessing apparatus for processing a picked-up image which is outputfrom an image pickup element with which a microlens array for obtainingthe picked-up image including ray directional information of an objectimage formed by a photographing optical system is arranged, comprises: arefocus processing unit configured to execute a refocus processing ofthe obtained picked-up image on the basis of the ray directionalinformation and generate a reconstruction image; and a defect pixeldetection unit configured to detect a defect pixel from the obtainedpicked-up image, wherein in a case where the picked-up image isobtained, the detection of the defect pixel of the obtained picked-upimage is performed, and in a case where the refocus processing isinstructed, the refocus processing is executed to the picked-up image inwhich the detection of the defect pixel is performed.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of the specification, illustrate exemplary embodiments, features,and aspects of the invention and, together with the description, serveto explain the principles of the invention.

FIG. 1 is a block diagram of an image pickup apparatus according to thefirst embodiment of the invention.

FIG. 2 is a block diagram of a construction according to an image pickupoptical system of the image pickup apparatus illustrated in FIG. 1.

FIG. 3 is a diagram schematically illustrating a pixel array of an imagepickup element of the image pickup apparatus in FIG. 1.

FIG. 4 is a constructional diagram of a unit pixel constructing thepixel array in FIG. 4.

FIG. 5 is a diagram in the case where an aperture of a photographinglens in the image pickup optical system in FIG. 2 is seen from theobject direction.

FIG. 6 is a diagram illustrating traces of rays of light from objects inthe image pickup optical system in FIG. 2.

FIGS. 7A and 7B are diagrams for describing the detecting operation ofan object distance by the image pickup optical system in FIG. 2.

FIG. 8 is a diagram illustrating a flowchart for the photographingoperation of the image pickup apparatus according to the firstembodiment of the invention.

FIG. 9 is a diagram illustrating a flowchart for the detecting operationof a defect pixel according to the first embodiment of the invention.

FIGS. 10A and 10B are diagrams for describing a detecting method of thedefect pixel according to the first embodiment of the invention.

FIG. 11 is a diagram illustrating a flowchart for the photographingoperation of an image pickup apparatus according to the secondembodiment of the invention.

DESCRIPTION OF THE EMBODIMENTS

Various exemplary embodiments, features, and aspects of the presentinvention will be described in detail below with reference to thedrawings.

First Embodiment

FIG. 1 is a block diagram of an image pickup apparatus according to thefirst embodiment of the invention.

In FIG. 1, an optical system 101 for photographing, such as lenses orthe like, a mechanical shutter 102, and an image pickup element 103 forconverting incident light into an electric signal are provided. Theimage pickup element 103 has: a photoelectric conversion unit 104 forconverting the incident light into the electric signal; and a signalamplification unit 105 for amplifying the electric signal.

An analog signal processing unit 106 obtains an image signal which isoutput from the image pickup element 103 and executes an analog signalprocessing thereon. The analog signal processing unit 106 has: a signalamplifier 107 for amplifying the analog signal; a clamp unit 108 forperforming a horizontal OB clamp; and an A/D converter 109 forconverting the analog signal into the digital signal.

A timing signal generation unit 110 generates signals for making theimage pickup element 103 and the analog signal processing unit 106operative. A drive unit 111 drives the optical system 101 and themechanical shutter 102. A digital signal processing unit 112 executes anecessary digital signal processing to photographed image data. Thedigital signal processing unit 112 includes: an image correction unit113; a defect pixel detection unit 114 for performing a defect pixeldetection according to the present embodiment; a signal amplificationunit 115 for amplifying the digital signal; and an image processing unit116 for executing a necessary image processing to the image data.

An image memory 117 stores the signal-processed image data. An imagerecording medium (shown as a recording medium) 118 is detachable fromthe image pickup apparatus. A recording unit 119 records thesignal-processed image data into the image recording medium 118. Animage display apparatus 120 displays the signal-processed image data. Adisplay unit 121 displays the image onto the image display apparatus120.

A system control unit 122 controls the whole image pickup apparatus. Anonvolatile memory (ROM) 123 stores: a program describing a controlmethod which is executed by the system control unit 122; control datasuch as parameters, tables, and the like which are used when executingthe program; and correction data such as defect addresses and the like.A volatile memory (RAM) 124 to which the program, control data, andcorrection data stored in the nonvolatile memory 123 are transferred andstored, is used when the system control unit 122 controls the imagepickup apparatus.

A photographing mode setting unit 125 performs a photographing conditionsetting such as ISO sensitivity setting and the like, a switchingbetween a still image photographing and a live-view driving, and thelike.

The photographing operation of the image pickup apparatus constructed asmentioned above according to the present embodiment will be describedhereinbelow.

It is assumed that prior to the photographing operation, the necessaryprogram, control data, and correction data are transferred from thenonvolatile memory 123 and stored into the volatile memory 124 at thetime of start of the operation of the system control unit 122 such asthe time of turn-on of a power source of the image pickup apparatus orthe like. Those program and data are used when the system control unit122 controls the image pickup apparatus. However, the system controlunit 122 may be also constructed in such a manner that additionalprogram and data can be transferred from the nonvolatile memory 123 intothe volatile memory 124 or the data in the nonvolatile memory 123 can bedirectly read out and used in accordance with necessity.

First, the optical system 101 such as lenses or the like is driven by acontrol signal from the system control unit 122 and forms an objectimage which has been set to proper brightness onto the image pickupelement 103. Subsequently, in the still image photographing mode, themechanical shutter 102 is driven by a control signal from the systemcontrol unit 122 so as to shield the image pickup element 103 from thelight in accordance with the operation of the image pickup element 103so that a necessary exposure time is obtained. At this time, if theimage pickup element 103 has an electronic shutter function, thenecessary exposure time may be assured in cooperation with themechanical shutter 102. In the moving image photographing mode and thelive-view driving mode, the mechanical shutter 102 is maintained in anopen state by a control signal from the system control unit 122 so thatthe image pickup element 103 is always exposed during the photographing.

The image pickup element 103 is driven by a drive pulse based on anoperation pulse which is generated by the timing signal generation unit110 which is controlled by the system control unit 122. Thephotoelectric conversion unit 104 converts the object image into theelectric signal by the photoelectric conversion. The signalamplification unit 105 multiplies the electric signal with a gain of anamplification factor which input in accordance with the incident lightamount and outputs a resultant signal as an analog image signal.

The analog image signal which is output from the image pickup element103 is processed by the analog signal processing unit 106 by theoperation pulse which is generated by the timing signal generation unit110 which is controlled by the system control unit 122. First, the PGAunit 107 multiplies the gain of the amplification factor which is set inaccordance with the incident light amount. The clamp unit 108 clamps asignal output in a horizontal OB area as a reference voltage. The A/Dconverter 109 converts the clamped signal into a digital image signal.

Subsequently, the digital image signal which is output from the analogsignal processing unit 106 is subjected to image processings such ascolor conversion, white balance, gamma correction, and the like, aresolution conversion processing, an image compression processing, andthe like by the digital signal processing unit 112 which is controlledby the system control unit 122.

First, in the image correction unit 113, the defect pixel is corrected,various kinds of image correction processings such as dark shadingcorrection and the like are executed. The defect pixel is detected fromthe picked-up image by the defect pixel detection unit 114.

The defect pixel which is corrected by the image correction unit 113 isa pixel which has previously been detected in a manufacturing step orthe like of the image pickup element 103 and in which information suchas a position and the like of such a pixel has been recorded. The defectpixel which is detected by the defect pixel detection unit 114 is apixel which is not detected in the manufacturing step or the like of theimage pickup element 103 and has newly become a defect in the subsequentstep, a pixel such as an RTS noise which became a defect or does notbecome a defect every photographing, or the like.

After that, the gain of the amplification factor which has been set inaccordance with the incident light amount is multiplied in the signalamplification unit 115. The image processings such as color conversion,white balance, gamma correction, and the like and various kinds of imageprocessings such as resolution conversion processing, image compressionprocessing, and the like are executed in the image processing unit 116.The refocus processing based on the ray directional information asmentioned above is also executed in the image processing unit 116.

The image memory 117 is used to temporarily store the digital imagesignal during the signal processing or store the image data serving as asignal-processed digital image signal. The image data which issignal-processed in the digital signal processing unit 112 and the imagedata stored in the image memory 117 are input into the recording unit119 and are converted into data (for example, file system data having alayer structure) suitable for the image recording medium 118. Theconverted image data is recorded into the image recording medium 118.The image data is also input into the digital signal processing unit 112and is subjected to the resolution conversion processing. After that, itis converted into a signal (for example, an analog signal of an NTSCsystem, or the like) suitable for the image display apparatus 120 by thedisplay unit 121 and is displayed to the image display apparatus 120.

In this instance, in response to a control signal from the systemcontrol unit 122, the digital signal processing unit 112 may output thedigital image signal to the image memory 117 or the recording unit 119as it is as image data without performing any signal processing to thedigital image signal. When there is a request from the system controlunit 122, the digital signal processing unit 112 outputs the digitalimage signal generated in the signal processing step or information ofthe image data to the system control unit 122. As information of theimage data, for example, there is information such as spatial frequencyof the image, average value of a designated area, data amount of acompressed image, and the like or information extracted therefrom.Further, when there is a request from the system control unit 122, therecording unit 119 outputs information such as type, free spacecapacity, and the like of the image recording medium 118 to the systemcontrol unit 122.

The reproducing operation in the case where the image data has beenrecorded in the image recording medium 118 will now be described.

The recording unit 119 reads out the image data from the image recordingmedium 118 in accordance with a control signal from the system controlunit 122. Similarly, if the image data is a compressed image, inresponse to a control signal from the system control unit 122, thedigital signal processing unit 112 executes an image expansionprocessing and stores the expanded data into the image memory 117. Theimage data stored in the image memory 117 is subjected to the refocusprocessing and the resolution conversion processing by the digitalsignal processing unit 112. After that, it is converted into a signalsuitable for the image display apparatus 120 by the display unit 121 andis displayed to the image display apparatus 120.

FIG. 2 is a block diagram illustrating a construction according to animage pickup optical system of the image pickup apparatus according tothe present embodiment. In the diagram, substantially the same componentelements as those in FIG. 1 are designated by the same referencenumerals and their description is omitted.

In FIG. 2, a photographing lens 201 and an MLA 202 serving as acomponent element of the image pickup element 103 are provided. A sensorarray 203 also serving as a component element of the image pickupelement 103 includes an array of a plurality of pixels (photoelectricconversion elements). A reference numeral 204 denotes an object.

The image pickup operation of the image pickup apparatus according tothe present embodiment will be described hereinbelow with reference toFIG. 2.

In a state where the mechanical shutter 102 is opened by the drive unit111, an image of the object 204 is formed onto the image pickup element103 by the photographing lens 201. A photosignal which entered the imagepickup element 103 is further converged by each microlens (hereinbelow,abbreviated to an ML) of the MLA 202 and enters each pixel of the sensorarray 203. A construction of the MLA 202 and sensor array 203 will bedescribed hereinafter with reference to FIG. 3. The photosignal whichentered the sensor array 203 is photoelectrically converted in eachpixel of the image pickup element 103 and is output as an electricsignal. Subsequent processings are executed in a manner similar to thatdescribed with reference to FIG. 1.

FIG. 3 is a diagram schematically illustrating a pixel array in the casewhere the image pickup element which is used in the image pickupapparatus according to the present embodiment is viewed on the objectside.

In FIG. 3, a unit pixel 301 corresponds to one pixel of the image afterthe reconstruction. The unit pixel 301 is constructed by a predeterminednumber (6 rows×6 columns) of photoelectric conversion elements(hereinbelow, also referred to as division pixels) 302. One ML 303 isarranged for every unit pixel 301.

In the present embodiment, as illustrated in FIGS. 2, 3, and 6, a pixelarray of the sensor array is set to an array of the unit pixels of (5rows×5 columns) each comprising division pixels of (6 rows×6 columns)for convenience of description. However, in the actual image pickupapparatus, it is assumed that millions to tens of millions unit pixelsare arranged.

FIG. 4 is a diagram illustrating an array arrangement of the divisionpixels in the unit pixel 301.

As described in FIG. 3, the unit pixel 301 is constructed by arrangingthe 36 (=6×6) division pixels 302. For the subsequent description, inthe present embodiment, it is assumed that the 36 division pixels arelabeled by p₁₁ to p₆₆ as shown in FIG. 4, respectively.

FIG. 5 is a diagram illustrating a pupil division in the case where anaperture of the photographing lens 201 is viewed from the direction ofthe photographing object.

As illustrated in FIG. 5, in the case where a pupil area of thephotographing lens 201 is divided into areas of the same number as thenumber of pixels existing under one ML, an image of light from one pupildivision area of the photographing lens 201 is formed in one divisionpixel. It is now assumed that F numbers of the photographing lens andthe ML almost coincide. When pupil division areas of the photographinglens illustrated in FIG. 5 are respectively labeled by a₁₁ to a₆₆, acorrespondence relation between the pupil division areas a₁₁ to a₆₆ ofthe photographing lens and the division pixels areas p₁₁ to p₆₆illustrated in FIG. 4 is of point symmetry when viewed from thedirection of the optical axis. Therefore, an image of light which exitsfrom the pupil division area a₁₁ of the photographing lens is formed inthe division pixel p₁₁ of the unit pixel 301 existing behind the ML. Ina manner similar to that mentioned above, an image of light which exitsfrom the pupil division area a₁₁ and passes through another ML is alsoformed in the division pixel p₁₁ of the unit pixel 301 existing behindsuch an ML.

FIG. 6 is a diagram illustrating traces of rays of light which enterfrom objects existing at various distances in the image pickup opticalsystem according to the present embodiment.

In FIG. 6, the light which exit from pupil areas a₁ to a₆ of thephotographing lens 201 and pass through the ML are received by divisionpixels p₁ to p₆ of the rear corresponding unit pixel, respectively.

The object 601 a is an object arranged at a position where its image isformed onto a plane A including the MLA 202 by the photographing lens201. Among the rays of light which exit from the object 601 a, the rayof light which passes through the outermost circumference of thephotographing lens and enters the sensor array 203 through the MLexisting on the optical axis is shown by a solid line.

The object 601 b is an object arranged at a remote position than theobject 601 a when viewed from the photographing lens 201. An image ofthe the object 601 b formed by the photographing lens 201 is formed ontoa plane B closer to the photographing lens than the plane A includingthe MLA 202. Among the rays of light which exit from the object 601 b,the ray of light which passes through the outermost circumference of thephotographing lens and enters the sensor array 203 through the MLexisting on the optical axis is shown by a broken line.

The object 601 c is an object arranged at a near position than theobject 601 a when viewed from the photographing lens 201. An image ofthe the object 601 c formed by the photographing lens 201 is formed ontoa plane C farther from the photographing lens than the plane A includingthe MLA 202. Among the rays of light which exit from the object 601 c,the ray of light which passes through the outermost circumference of thephotographing lens and enters the sensor array 203 through the MLexisting on the optical axis is shown by an alternate long and shortdash line.

As shown by the trace of each ray of light illustrated in FIG. 6, thedivision pixel in the sensor array 203 into which the ray of light fromthe object enters differs in dependence on a distance from thephotographing lens 201 to the object 601. A positional relationshipbetween such a distance and the division pixel gives the ray directionalinformation. By using such a principle, the image pickup apparatushaving such a construction as mentioned above reconstructs an imagesignal after the photographing, thereby enabling an image focused ontothe objects existing at various distances to be generated (refocusprocessing).

As described with reference to FIG. 6, since the division pixels p₁₁ top₆₆ shown in FIG. 4 have received the light which pass through thedifferent pupil areas for the photographing lens, by using thoseinformation, the operation for detecting the distance to the object canbe also executed.

FIGS. 7A and 7B are diagrams for describing the detecting operation ofan object distance in the image pickup apparatus according to thepresent embodiment.

As illustrated in FIG. 7A, the outputs p₁₁ to p₆₆ of the division pixelscorresponding to each microlens are added and two signals which werepupil-divided in the horizontal direction are formed as shown by thefollowing equations (1) and (2).

$\begin{matrix}{A = {\sum\limits_{a = 1}^{6}{\sum\limits_{b = 1}^{3}\left( P_{ab} \right)}}} & (1) \\{B = {\sum\limits_{a = 1}^{6}{\sum\limits_{b = 4}^{6}\left( P_{ab} \right)}}} & (2)\end{matrix}$

As illustrated in FIG. 6, the pupil area of the photographing lens whichis observed by each combined signal A shown by the equation (1) receivesthe light flux which pass through the exit pupil areas a₁ to a₃ of thephotographing lens. On the basis of this, a one-dimensional image signalA₁ (i=1, 2, 3, n) is generated by arranging A₁ to A_(n) obtained from apixel group corresponding to the n MLs arranged continuously in thehorizontal direction as illustrated in FIG. 7B.

Similarly, when a one-dimensional image signal B_(i) (i=1, 2, 3, . . . ,n) is generated by arranging combined signals B which are calculated bythe equation (2), A_(i) and B_(i) are signals viewing the right side andthe left side of the exit pupil of the photographing lens, respectively.Therefore, by detecting relative positions of A_(i) and B_(i) andmultiplying a relative deviation amount therebetween with apredetermined conversion coefficient, the distance detecting operationbased on the phase difference detecting method can be executed.

By generating A_(i) and B_(i) at an arbitrary position in the displayscreen, a focus position (defocus amount) at that position can becalculated. Therefore, by driving the focus lens in accordance with acalculation result, the automatic focus adjustment can be alsoperformed.

FIG. 8 is a diagram illustrating a flowchart for the photographingoperation of the image pickup apparatus according to the presentembodiment.

In FIG. 8, first, the mode such as still image photographing, movingimage photographing, focus detecting photographing, or the like is setby the system control unit 122 on the basis of an input or the like bythe photographing mode setting unit 125 (step S801). Subsequently, thesystem control unit 122 performs an initial setting of the photographingconditions such as sensitivity, iris value, exposure time, and the likein accordance with the set mode (step S802).

Subsequently, the system control unit 122 starts the automatic focusadjustment, that is, what is called an auto focus (AF) for automaticallydriving the focus lens so as to focus onto the object (step S803). As anAF method, besides the method using a contrast detection, a method usinga dedicated distance measuring sensor or the like is also known.Further, by using the feature of the light field camera according to thepresent embodiment, the signals of the photoelectric conversion elementsexisting in the different quadrants under the microlens are properlyread out, and those signals can be also used as signals of the phasedifference detecting method AF. Such a method is as mentioned above withreference to FIGS. 7A and 7B.

In accordance with a result of the AF, the system control unit 122drives the focus lens of the photographing optical system 101 throughthe drive unit 111.

Subsequently, in response to a depression of a release button (notshown), the system control unit 122 controls the mechanical shutter 102and exposes the image pickup element 103 (step S804).

Subsequently, the system control unit 122 reads out information of afixed defect pixel which is previously extracted in the producing stepof the image pickup apparatus from the nonvolatile memory 123 andperforms the correction of the relevant pixel by controlling the imagecorrection unit 113 (step S805).

Subsequently, a defect pixel detection in the photographed image isperformed by the defect pixel detection unit 114 of the digital signalprocessing unit 112 (step S806). A defect pixel detecting method will bedescribed in detail hereinafter with reference to FIGS. 9, 10A, and 10B.The detected defect pixel is corrected in the digital signal processingunit 112.

After that, the system control unit 122 discriminates whether or not theRAW recording mode is selected by the photographing mode setting unit125 or the like (step S807). If the RAW recording mode is selected, thepicked-up image is recorded in what is called an RAW mode for recordingthe picked-up image as it is into the recording medium 118 (step S808).Irrespective of the RAW recording mode, by adding up the signals of thephotoelectric conversion elements under the same ML, a provisionalreconstruction image having the same number of pixels as that of the MLsin the MLA 202 or a thumbnail image reduced in order to display theprovisional reconstruction image is generated and recorded (step S809).

After that, in the case where the focus lens position decided in the AFin step S803 differs from a desired position of the photographer, or thelike, a distance of a target object (for example, 601 b in FIG. 6) andthe object of the provisional reconstruction image displayed on thedisplay apparatus 120 are designated. Such a designation is performed bya refocus distance setting unit (not shown in FIG. 1). When they aredesignated, the system control unit 122 allows the image processing unit116 to execute the refocus reconstruction processing to the picked-upimage in which the defect pixel is detected in step S806 and corrected(picked-up image serving as a subject of the RAW recording) (step S810).

If the picked-up image is recorded in the RAW recording mode, since therefocus reconstruction processing may be executed after thephotographing, the processings in step S809 and subsequent steps may beexecuted by an image processing apparatus which simulates a part of theimage pickup apparatus in FIG. 1 or by a computer or the like accordingto an image processing method recorded in the memory or the like.

Finally, the image signal is output to the image memory 117, recordingunit 119, or display unit 121 (step S811) and the photographingoperation is finished.

Subsequently, a detection construction of the defect pixel according tothe present embodiment will be described with reference to FIGS. 9, 10A,and 10B.

In the light field camera according to the present embodiment, asalready mentioned above, the image in which the signals are arranged inorder of the outputs from the image pickup element does not always havethe arrangement according to the positional relationship of the objectimages but is the data which is also accompanied with discontinuousportions. Therefore, in the case of performing the real-time defectpixel detection, it is difficult to discriminate whether the relevantpixel is a defect, based on all of the peripheral pixel signals like areal-time defect pixel detection in the related art. The presentembodiment, therefore, is constructed in such a manner that whilediscriminating whether or not the defect pixel detection can beperformed, the detection of the defect pixel is performed.

FIG. 9 is a diagram illustrating a flowchart for the detecting operationof a defect pixel according to the present embodiment.

In FIG. 9, when the defect pixel detection is started under control ofthe system control unit 122, first, a fluctuation of the output signalsof the 36 division pixels 302 constructing one unit pixel 301 includedin the pixel array is calculated (step S901). In the present embodiment,a standard deviation σ is used as a numerical value showing thefluctuation. However, it is an example and another value may be used solong as it can express the fluctuation of the output signals of thedivision pixels 302.

Subsequently, whether or not the standard deviation σ calculated in stepS901 is smaller than a predetermined value is discriminated (step S902).

In the description in step S902, if it is determined that the standarddeviation σ is smaller than the predetermined value, the defect pixeldetection is performed to the division pixels 302 in the unit pixel 301(step S903). Specifically speaking, if there is a division pixel 302having an output signal value such that a difference value between thatoutput signal value and an average value of the output signals of the 36division pixels 302 does not fall within a predetermined range, such apixel is detected as a defect pixel.

In the description in step S902, if it is determined that the standarddeviation σ is larger than the predetermined value, it is decided that aprecision adapted to detect the defect pixel is not guaranteed to thedivision pixels 302 in such a unit pixel 301, and the defect pixeldetection is not performed.

After that, whether or not the unit pixel 301 to which the detection isperformed is a last unit pixel is discriminated (step S904). If thereare still unit pixels to which the detection is not performed yet, theprocessing routine is returned to step S901 and the discrimination aboutthe next unit pixel is performed. If it is determined that the detectionof the last unit pixel is finished, the defect pixel detecting routineis finished.

FIGS. 10A and 10B are diagrams for describing a detecting methodaccording to the present embodiment.

FIG. 10A is a diagram showing an output level of each division pixel inthe case where a luminance difference in the area of the object fromwhich the subject unit pixel 301 receives the light is small. In FIG.10A, it is assumed that the division pixel p₂₅ is a defect pixel.

In the state of FIG. 10A, since a difference of a photosignal amount ofeach division pixel is small, the standard deviation value σ showing thefluctuation of the output signals is small. Therefore, the image pickupapparatus according to the invention determines that this unit pixel isa pixel in which the defect pixel detection can be performed. Thedivision pixel p₂₅ in which the difference from the signal output valueof another division pixel is large is detected as a defect pixel.

FIG. 10B is a diagram showing an output level of each division pixel inthe case where the luminance difference in the area of the object fromwhich the subject unit pixel 301 receives the light is large. In FIG.10B, it is also assumed that the division pixel p₂₅ is a defect pixel.

In the state of FIG. 10B, since the difference of the photosignal amountof each division pixel is large, the standard deviation value σ showingthe fluctuation of the output signals is large. Therefore, the imagepickup apparatus according to the invention determines that the defectpixel detection should not be performed with respect to this unit pixel.

As a detecting method of the defect pixel according to the presentembodiment described with reference to FIGS. 9, 10A, and 10B, a methodwhereby the defect pixel is detected by comparing with the average valueof the output values of all of the division pixels in the unit pixel isused. However, the invention is not limited to such a method but theoutput signal amount may be compared with those of only the peripheralpixels of the detection subject pixel.

Although the method of comparing the division pixels in one unit pixelhas been described above, the invention is not limited to it. Forexample, the following methods can be also combined and used: that is, amethod whereby the division pixels existing at the same position in therespective peripheral unit pixels are compared; and a method whereby thepixels which output absolute values which are not obviously proper suchas values which are fairly smaller than a dark level are detected, orthe like.

In the foregoing embodiment, it is determined that when the standarddeviation value is smaller than the predetermined value, the defectdivision pixels in the unit pixel are detected. The division pixelhaving the output signal value in which the difference value from theaverage value of the output signals of the division pixels in the unitpixel does not lie within the predetermined range is detected as adefect pixel. In this case, it is considered that the smaller thestandard deviation is, the smaller the fluctuation range of thedifference value is. Therefore, it is also possible to construct adetection method in such a manner that when the defect pixel isdetected, the predetermined range is changed to a small range inaccordance with the decrease in standard deviation value, therebyraising the detection precision of the defect pixel.

Or, since the area which is not focused in the image appears almost tobe a uniform luminance area, it is also possible to construct adetection method in such a manner that a defocus amount of theperipheral area of the detection subject unit pixel of the defect pixelis calculated and, when it is larger than a predetermined value, adiscrimination range of the difference value is decreased.

Second Embodiment

The present embodiment has such a construction that the operationalconstruction such that even after the refocus image is reconstructed,the detection and correction of the defect pixel are performed by thedigital signal processing unit 112 is added to the operation of theimage pickup apparatus of the first embodiment. Therefore, since theconstruction of the image pickup apparatus itself in the presentembodiment is similar to that of FIG. 1, its description is omittedhere.

FIG. 11 is a diagram illustrating a flowchart for the photographingoperation according to the second embodiment. In the flowchart,substantially the same processing steps as those in FIG. 8 aredesignated by the same step numbers. FIG. 11 differs from FIG. 8 withrespect to only a point that a defect correction (step S1101) is addedafter the image processing of step S810 of reconstructing the refocusimage. Therefore, in the present embodiment, only the defect correctionin step S1101 will be described. When the setting by the refocusdistance setting unit is not performed, the defect pixel correction instep S1101 as well as the signal processing (refocus processing) of stepS810 is performed. Whether or not the execution of the detection andcorrection processings of the defect pixel in the present embodiment arepermitted or inhibited may be decided in accordance with the number ofunit pixels in which the fluctuation of the pixel outputs which iscalculated in step S901 is large and with their distribution area ofthose unit pixels. Those processings can be performed under control ofthe system control unit 122.

The detection of the defect pixel in step S1101 is performed to thepixel of the reconstructed image (pixel in which the division pixelswere added). The detecting method in this case is performed bydiscriminating a level difference from the average value or median valueof the peripheral pixels of the detection subject pixel. However, thedetecting method is not limited to it. For example, as disclosed inJapanese Patent Application Laid-Open No. 2005-286825, a plurality ofdiscrimination processings may be provided in order to avoid such asituation that the pixel is determined as a defect pixel from thedifference value in the edge portion.

According to the foregoing construction of the present embodiment, theimage quality of the reconstruction image can be further improved bycorrecting the defect pixel which is not corrected in step S806. Sincethe division pixels which are detected in step S806 and corrected aremerely added as one division pixel in the reconstruction of the refocusimage, such a correction becomes inconspicuous in the reconstructionimage and the effect of the correction in step S1101 is not decreased.

Although the present embodiments of the invention have been describedabove with reference to FIGS. 1 to 11, the invention is not limited toit but various forms can be also used.

For example, in the pixel arrangement of the present embodiment of theinvention, in order to easily describe the pixel structure, the numberof division pixels under the same ML is set to (6×6). However, theinvention is not limited to it but the unit pixel may be constructed soas to have any number of division pixels of an arbitrary shape.

Although the present embodiments of the invention have been describedabove on the assumption that the correction of the detected defect pixeland the fixed defect pixel which has previously been extracted in theproducing step or the like is performed prior to the reconstruction suchas a refocus or the like. However, the invention is not limited to itbut may be constructed in such a manner that the detection of the defectpixel is performed prior to the reconstruction and the system controlunit 122 holds the detection result and corrects the pixels of the imageafter the reconstruction on the basis of the held detection result.

In the present embodiment of the invention described with reference toFIG. 1, it has been described above on the assumption that the imageprocessing such as an image reconstruction or the like is executed bythe digital signal processing unit 112 serving as one of the componentelements of the image pickup apparatus under control of the systemcontrol unit 122. However, it is not always necessary that the imageprocessing is executed in the image pickup apparatus. Specificallyspeaking, it is also possible to construct in such a manner that theimage processing unit is provided in another apparatus, for example, aPC (Personal Computer) or the like, the image pickup data obtained bythe image pickup apparatus is transferred to the PC, and the imageprocessing is executed in the PC. In this case, a CPU of the PC plays arole of the system control unit.

Each unit constructing the image processing apparatus in the presentembodiments of the invention mentioned above and each processing step ofthe image processing method can be realized by a method whereby theprogram stored in the RAM, ROM, or the like of the CPU operates. Theprogram and a computer-readable storage medium in which the program hasbeen stored are incorporated in the invention.

The invention can be also embodied as, for example, a system, anapparatus, a method, a program, a storage medium, or the like.Specifically speaking, the invention can be also applied to a systemconstructed by a plurality of apparatuses or to an apparatus constructedby one equipment.

The invention incorporates a case where a program of software forrealizing the functions of the present embodiments as mentioned above(program corresponding to the flowchart of FIG. 8, 9, or 11 in thepresent embodiments) is directly supplied to a system or apparatus or issupplied from a remote place. The invention also incorporates a casewhere a computer of the system or apparatus reads out and executes aprogram code of the supplied program.

Therefore, the program code itself which is installed into a computer inorder to realize the functions and processings of the invention by thecomputer also realizes the invention. That is, a computer program itselffor realizing the functions and processings of the invention is alsoincorporated in the invention. In this case, any form such as objectcode, program which is executed by an interpreter, script data which issupplied to the OS, or the like may be used so long as it has thefunctions of the program.

As a storage medium for supplying the program, for example, there is aflexible disk, a hard disk, an optical disk, a magnetooptic disk, or thelike. Further, there is an MO, a CD-ROM, a CD-R, a CD-RW, a magnetictape, a nonvolatile memory card, a ROM, a DVD (DVD-ROM, DVD-R), or thelike.

As another program supplying method, there is a method whereby acomputer is connected to Homepage of the Internet by using a browser ofa client computer. The program can be also supplied by supplying thecomputer program itself of the invention from Homepage or by downloadinga compressed file including an automatic installing function into astorage medium such as a hard disk or the like.

The program supplying method can be also realized by a method wherebythe program code constructing the program of the invention is dividedinto a plurality of files and each file is downloaded from differentHomepage. That is, a WWW server for allowing a plurality of users todownload a program file for realizing the functions and processings ofthe invention by the computer is also incorporated in the invention.

As another method, the program supplying method can be also realized bya method whereby the program of the invention is encrypted, stored intothe storage medium such as a CD-ROM or the like, and distributed to theusers, the users who can clear predetermined conditions are allowed todownload key information for decrypting the encryption from Homepagethrough the Internet, and by using the key information, the encryptedprogram is executed and installed into the computer.

The functions of the present embodiments mentioned above are realized bya method whereby the computer executes the read-out program. Further,the functions of the present embodiments mentioned above are alsorealized by a method whereby the OS or the like which operates on thecomputer executes a part or all of actual processings on the basis ofinstructions of the program, and those functions are realized by thoseprocessings.

Further, as another method, the functions of the present embodimentsmentioned above are also realized by a method whereby the program whichis read out of the storage medium is written into a memory provided fora function expanding board inserted in a computer or a functionexpanding unit connected to the computer, a CPU or the like provided forthe function expanding board or function expanding unit executes a partor all of actual processings on the basis of instructions of theprogram, and those functions are realized by those processings.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

This application claims the benefit of Japanese Patent Application No.2012-199449 filed on Sep. 11, 2012, which is hereby incorporated byreference herein in its entirety.

What is claimed is:
 1. An image processing apparatus for processing apicked-up image which is output from an image pickup element having amicrolens array, a plurality of pixels of the image pickup element beingassigned to one microlens of the microlens array, configured to pick upan image, comprising: one or more processors; and at least one memorycoupled to the one or more processors, the at least one memory havingstored thereon instructions which, when executed by the one or moreprocessors cause the image processing apparatus to: obtain the picked-upimage which is output from the image pickup element; perform imageprocessing on the obtained picked-up image based on ray directionalinformation of the obtained picked-up image as refocus processing so asto generate a reconstruction image whose focal length is different froma focal length of the obtained picked-up image; detect a defect pixelfrom the obtained picked-up image; and control in such a manner that thedetection of the defect pixel of the obtained picked-up image isperformed, and the refocus processing is performed after performing thedetection of the defect pixel on the picked-up image in which thedetection of the defect pixel is performed.